﻿using System;
using System.IO;
using System.Net;
using System.Windows;
using System.ComponentModel;
using System.Windows.Markup;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Navigation;

namespace SkypieeClient
{
    [ContentProperty("Scale")]
    public partial class TabContent
    {
        public TabContent()
        {
            this.InitializeComponent();

            // Insert code required on object creation below this point.
        }

        public double Scale
        {
            get { return (double)GetValue(ScaleProperty); }
            set { SetValue(ScaleProperty, value); }
        }

        public static readonly DependencyProperty ScaleProperty =
            DependencyProperty.Register("Scale", typeof(double), typeof(TabContent));

        private void ListBox1_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            
        }

        private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            Button b = (Button)sender;
            AvatarInfo ai = new AvatarInfo((Window1)App.Current.MainWindow, (Skypiee.Core.SkypieeUser)b.DataContext);
            Window1 w = (Window1)App.Current.MainWindow;
            w.CheckBoxOnline.IsEnabled = false;
            w.TabControlMain.IsEnabled = false;
            w.MainGrid.Children.Add(ai);
        }
        
        private void Label_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            
            Label i = (Label)sender;
            SKYPE4COMLib.IUser iu = (SKYPE4COMLib.IUser)i.Tag;
            
            if (iu.OnlineStatus == SKYPE4COMLib.TOnlineStatus.olsOffline)
                i.Foreground = Brushes.Silver;
            else
                i.Foreground = Brushes.Yellow;
        }


    }
}